<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Inode pointer structure</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Inode_pointer_structure"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Inode_pointer_structure rootpage-Inode_pointer_structure skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main">inode pointer structure</span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<style data-mw-deduplicate="TemplateStyles:r1305433154">
/* start https://en.wikipedia.org/ */
.mw-parser-output .ambox{border:1px solid #a2a9b1;border-left:10px solid #36c;background-color:#fbfbfb;box-sizing:border-box}.mw-parser-output .ambox+link+.ambox,.mw-parser-output .ambox+link+style+.ambox,.mw-parser-output .ambox+link+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+style+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+link+.ambox{margin-top:-1px}html body.mediawiki .mw-parser-output .ambox.mbox-small-left{margin:4px 1em 4px 0;overflow:hidden;width:238px;border-collapse:collapse;font-size:88%;line-height:1.25em}.mw-parser-output .ambox-speedy{border-left:10px solid #b32424;background-color:#fee7e6}.mw-parser-output .ambox-delete{border-left:10px solid #b32424}.mw-parser-output .ambox-content{border-left:10px solid #f28500}.mw-parser-output .ambox-style{border-left:10px solid #fc3}.mw-parser-output .ambox-move{border-left:10px solid #9932cc}.mw-parser-output .ambox-protection{border-left:10px solid #a2a9b1}.mw-parser-output .ambox .mbox-text{border:none;padding:0.25em 0.5em;width:100%}.mw-parser-output .ambox .mbox-image{border:none;padding:2px 0 2px 0.5em;text-align:center}.mw-parser-output .ambox .mbox-imageright{border:none;padding:2px 0.5em 2px 0;text-align:center}.mw-parser-output .ambox .mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output .ambox .mbox-image-div{width:52px}@media(min-width:720px){.mw-parser-output .ambox{margin:0 10%}}@media print{body.ns-0 .mw-parser-output .ambox{display:none!important}}
/* end https://en.wikipedia.org/ */
</style>
<p>The <b>inode pointer structure</b> is a structure adopted by the <a href="Inode" title="Inode">inode</a> of a file in the <a href="Version_6_Unix" title="Version 6 Unix">Version 6 Unix</a> file system, <a href="Version_7_Unix" title="Version 7 Unix">Version 7 Unix</a> file system, and <a href="Unix_File_System" title="Unix File System">Unix File System</a> (UFS) to list the addresses of a file's <a href="Block_(data_storage)" title="Block (data storage)">data blocks</a>. It is also adopted by many related file systems, including the <a href="Ext3" title="Ext3">ext3</a> file system, popular with Linux users.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Structure">Structure</h2></div>
<p>In the file system used in <a href="Version_6_Unix" title="Version 6 Unix">Version 6 Unix</a>, an inode contains eight pointers:<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>
</p>
<ul><li>8 <b>direct pointer</b> that directly point to blocks of a file with eight or fewer blocks;</li>
<li>8 <b>singly indirect pointers</b> (pointing to a block of direct pointers) for files with more than eight blocks.</li></ul>
<p>In the file system used in <a href="Version_7_Unix" title="Version 7 Unix">Version 7 Unix</a>, an inode contains thirteen pointers:<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>
</p>
<ul><li>10 <b>direct pointers</b> that directly point to blocks of a file with eight or fewer blocks;</li>
<li>1 <b>singly indirect pointer</b> (pointing to a block of direct pointers)</li>
<li>1 <b>doubly indirect pointer</b> (pointing to a block of single indirect pointers)</li>
<li>1 <b>triply indirect pointer</b> (pointing to a block of doubly indirect pointers)</li></ul>
<p>In the <a href="Unix_file_system" class="mw-redirect" title="Unix file system">Unix file system</a>, an inode contains fifteen pointers:<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup>
</p>
<ul><li>12 <b>direct pointers</b> that directly point to blocks of the file's data</li>
<li>1 <b>singly indirect pointer</b> (pointing to a block of direct pointers)</li>
<li>1 <b>doubly indirect pointer</b> (pointing to a block of single indirect pointers)</li>
<li>1 <b>triply indirect pointer</b> (pointing to a block of doubly indirect pointers)</li></ul>
<p>The levels of indirection indicate the number of pointer that must be followed before reaching actual file data.
</p>
<div class="mw-heading mw-heading2"><h2 id="Key_features">Key features</h2></div>
<div class="mw-heading mw-heading3"><h3 id="Fixed_logical_block_size">Fixed logical block size</h3></div>
<p>The structure is partially illustrated in the diagram accompanying this article. The structure allows for inodes to describe very large files in file systems with a fixed logical block size. Central to the mechanism is that blocks of addresses (also called <i>indirect blocks</i>) are only allocated as needed. For example, in the <a href="Unix_file_system" class="mw-redirect" title="Unix file system">Unix file system</a>, a 12-block file would be described using just the inode because its blocks fit into the number of direct pointers available. However, a 13-block file needs an indirect block to contain the thirteenth address.
</p>
<div class="mw-heading mw-heading3"><h3 id="Ease_of_data_location">Ease of data location</h3></div>
<p>The inode pointer structure not only allows for files to easily be allocated to non-contiguous blocks, it also allows the data at a particular location inside a file to be easily located. This is possible because the logical block size is fixed. For example, if each block is 8 kB, file data at 112 kB to 120 kB would be pointed to by the third pointer of the first indirect block (assuming twelve direct pointers in the inode pointer structure).
</p>
<div class="mw-heading mw-heading3"><h3 id="Indirect_blocks">Indirect blocks</h3></div>
<p>Unlike inodes, which are fixed in number and allocated in a special part of the file system, the indirect blocks may be of any number and are allocated in the same part of the file system as data blocks. The number of pointers in the indirect blocks is dependent on the block size and size of block pointers. Example: with a 512-byte block size, and 4-byte block pointers, each indirect block can consist of 128 (512 / 4) pointers.
</p>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */
.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}
/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */
.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}
/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFRitchieThompson1974" class="citation journal cs1"><a href="Dennis_Ritchie" title="Dennis Ritchie">Ritchie, Dennis M.</a>; <a href="Ken_Thompson" title="Ken Thompson">Thompson, Ken</a> (July 1974). <a rel="nofollow" class="external text" href="https://dsf.berkeley.edu/cs262/unix.pdf">"The UNIX Time-Sharing System"</a> <span class="cs1-format">(PDF)</span>. <i>Communications of the ACM</i>. <b>17</b> (7): 369.</cite></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><cite id="CITEREFRitchieThompson" class="citation web cs1"><a href="Dennis_Ritchie" title="Dennis Ritchie">Ritchie, Dennis M.</a>; <a href="Ken_Thompson" title="Ken Thompson">Thompson, Ken</a>. <a rel="nofollow" class="external text" href="https://www.bell-labs.com/usr/dmr/www/cacm.pdf">"The UNIX Time-Sharing System"</a> <span class="cs1-format">(PDF)</span>.</cite></span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://docs.oracle.com/cd/E19455-01/805-7228/6j6q7uf0r/index.html">"The Structure of UFS File System Cylinder Groups"</a>. <i>System Administration Guide</i>.</cite></span>
</li>
</ol></div></div>
<ul><li><a rel="nofollow" class="external text" href="https://lwn.net/Articles/187321/">Ext3 for large file systems</a>, LWN.net, June 12, 2006.</li>
<li><cite id="CITEREFMarshall_Kirk_McKusickWilliam_N._JoySamuel_J_LefflerRobert_S._Fabry1984" class="citation journal cs1"><a href="Marshall_Kirk_McKusick" title="Marshall Kirk McKusick">Marshall Kirk McKusick</a>; <a href="Bill_Joy" title="Bill Joy">William N. Joy</a>; <a href="Samuel_J_Leffler" class="mw-redirect" title="Samuel J Leffler">Samuel J Leffler</a>; Robert S. Fabry (February 18, 1984). <a rel="nofollow" class="external text" href="http://www.cs.berkeley.edu/~brewer/cs262/FFS.pdf">"A Fast File System for UNIX"</a> <span class="cs1-format">(PDF)</span>. <i><a href="Computer_Systems_Research_Group" title="Computer Systems Research Group">Computer Systems Research Group</a></i>.</cite></li></ul></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-02-16" href="https://en.wikipedia.org/wiki/?title=Inode_pointer_structure&oldid=1275961252">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
</body></html>